#include "StdAfx.h"
#include "IEWrapper.h"
#include <htmlctrl.h>

WNDPROC GetSystemClassProc(LPCTSTR lpClassName)
{
	WNDCLASS ws;

	::GetClassInfo(NULL, lpClassName, &ws);

	return ws.lpfnWndProc;
}

CIEWrapper::CIEWrapper(void)
{
}

CIEWrapper::~CIEWrapper(void)
{
}

LRESULT CALLBACK CIEWrapper::IEProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	WNDPROC pIEProc = GetSystemClassProc(WC_HTML);

	switch ( message )
	{
	case WM_PAINT:
		{
			HWND hParent = ::GetParent(hWnd);
			::SetFocus(hParent);

			return ::PostMessage(hParent, message, wParam, lParam);
		}
		break;

	default:
		break;
	}

	return ::CallWindowProc(pIEProc, hWnd, message, wParam, lParam);
}
